
#ifndef __CE_RANGE_H__
#define __CE_RANGE_H__


class ceRange
{
private:
	float minVal;
	float maxVal;

public:
	ceRange (float minVal = 0.0f, float maxVal = 100.0f) : minVal (minVal), maxVal (maxVal) { }

	void SetMin (float minVal)
	{
		this->minVal = minVal;;
	}

	void SetMax (float maxVal)
	{
		this->maxVal = maxVal;
	}

	float GetMin () const
	{
		return minVal;
	}

	float GetMax () const
	{
		return maxVal;
	}

	bool IsInRange (float value) const
	{
		return value >= minVal && value <= maxVal;
	}

	float MakeInRange (float value)
	{
		if (value < minVal)
		{
			return minVal;
		}
		else if (value > maxVal)
		{
			return maxVal;
		}
		else 
		{
			return value;
		}
	}

};

#endif /* ! __CE_RANGE_H__ */ 
